package com.sneaker.shower.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.sneaker.shower.entity.dto.coupon.CouponRespDTO;
import com.sneaker.shower.entity.enums.SubOrderStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@ApiModel(value = "子订单详情")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SubOrderDTO {

    private String guid;

    @ApiModelProperty("下单时的请求入参，用于传递需要入库的产品GUID")
    private List<GoodsItemDTO> goodsItemDTOList;

    @ApiModelProperty("查询订单时的返回参数，订单产品由最上层的菜单开始")
    private List<MenuDTO> ItemsDTOList;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime gmtCreate;

    @ApiModelProperty("修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime gmtModified;

    @ApiModelProperty("订单总价")
    private BigDecimal orderPrice;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty(value = "是否已审核，true：已审核， false未审核（只有已审核的订单能够支付）")
    private Boolean isChecked;

    @ApiModelProperty(value = "订单名字")
    private String orderName;

    @ApiModelProperty(value = "订单图片")
    private String imageUrl;

    @ApiModelProperty(value = "产品名字拼接后字符串")
    private String productName;

    @ApiModelProperty(value = "订单数量")
    private Integer orderCount = 1;

    @ApiModelProperty(value = "订单状态：0、待下单，1、待邮寄，2、待审核，3、审核通过，4、审核失败，5、待支付，6、支付中，7、支付成功，8、支付失败，" +
            "9、处理中，10、处理完成待寄回，11、已寄回，12、订单完成")
    private Byte status = SubOrderStatusEnum.WAIT_FOR_SUBMITTING.getCode();

    @ApiModelProperty("图片1")
    private String img1;

    @ApiModelProperty("图片2")
    private String img2;

    @ApiModelProperty("图片3")
    private String img3;

    @ApiModelProperty("图片4")
    private String img4;

    @ApiModelProperty("图片5")
    private String img5;

    @ApiModelProperty("图片6")
    private String img6;

    @ApiModelProperty("收获地址guid")
    private String receiveGuid;

    /**
     * 快递单号
     */
    private String trackingNumber;

    @ApiModelProperty("用户收货信息")
    private String address;

    /**
     * 客服寄出的快递单号
     */
    private String sysTrackingNumber;

    private String sysDeliveryId;

    private String deliveryId;

    @ApiModelProperty("是否使用优惠券")
    private Boolean usedCoupon;

    @ApiModelProperty("优惠券信息")
    private CouponRespDTO couponRespDTO;
}


